import config from "@/config"
import http from "@/utils/request"

export default {
    menu: {
        list_all: {
            url: `${config.API_URL}/api/auth/setting/menu/list/all`,
            name: "不分页获取菜单列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        update: {
            url: `${config.API_URL}/api/auth/setting/menu/update`,
            name: "更新菜单信息",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        create: {
            url: `${config.API_URL}/api/auth/setting/menu/create`,
            name: "创建菜单",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        del: {
            url: `${config.API_URL}/api/auth/setting/menu/delete`,
            name: "删除菜单",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        }
    },
    role: {
        list: {
            url: `${config.API_URL}/api/auth/setting/role/list`,
            name: "分页获取角色列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        list_all: {
            url: `${config.API_URL}/api/auth/setting/role/list/all`,
            name: "不分页获取角色列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        update: {
            url: `${config.API_URL}/api/auth/setting/role/update`,
            name: "更新角色信息",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        create: {
            url: `${config.API_URL}/api/auth/setting/role/create`,
            name: "创建角色",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        del: {
            url: `${config.API_URL}/api/auth/setting/role/delete`,
            name: "删除角色",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        permission_list: {
            url: `${config.API_URL}/api/auth/setting/role/permission/list`,
            name: "获取角色权限列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        permission_update: {
            url: `${config.API_URL}/api/auth/setting/role/permission/update`,
            name: "更新角色权限",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        }
    },
    api: {
        list: {
            url: `${config.API_URL}/api/auth/setting/api/list`,
            name: "获取接口列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        sync: {
            url: `${config.API_URL}/api/auth/setting/api/sync`,
            name: "同步接口",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        }
    },
    user: {
        list: {
            url: `${config.API_URL}/api/auth/setting/user/list`,
            name: "获取用户列表",
            get: async function (params) {
                return await http.get(this.url, params);
            }
        },
        update: {
            url: `${config.API_URL}/api/auth/setting/user/update`,
            name: "更新用户信息",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        create: {
            url: `${config.API_URL}/api/auth/setting/user/create`,
            name: "创建用户",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        del: {
            url: `${config.API_URL}/api/auth/setting/user/delete`,
            name: "删除用户",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
        change_role: {
            url: `${config.API_URL}/api/auth/setting/user/change/role`,
            name: "更新用户角色",
            post: async function (data = {}) {
                return await http.post(this.url, data);
            }
        },
    }
}
